/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

export const enum YogaAlign {
  AUTO = 0,
  FLEX_START = 1,
  CENTER = 2,
  FLEX_END = 3,
  STRETCH = 4,
  BASELINE = 5,
  SPACE_BETWEEN = 6,
  SPACE_AROUND = 7,

//  private final int mIntValue;
//
//  YogaAlign(int intValue) {
//  mIntValue = intValue;
}

//public int intValue() {
//  return mIntValue;
//}

export function getYogaAlignFromNumber(value: number): YogaAlign | never {
  switch (value) {
    case 0: return YogaAlign.AUTO;
    case 1: return YogaAlign.FLEX_START;
    case 2: return YogaAlign.CENTER;
    case 3: return YogaAlign.FLEX_END;
    case 4: return YogaAlign.STRETCH;
    case 5: return YogaAlign.BASELINE;
    case 6: return YogaAlign.SPACE_BETWEEN;
    case 7: return YogaAlign.SPACE_AROUND;
    default: throw new Error("Unknown enum value: " + value);
  }
}
